<template>
  <a-card :bordered='false' class='card-area'>
    <!-- 查询区域 11111-->
    <div class='table-page-search-wrapper'>
      <a-form layout='inline' :label-col='labelCol' @keyup.enter.native='searchQuery'>
        <a-row :gutter='24'>
          <a-col :md='8' :sm='8'>
            <a-form-item label='申请人'>
              <a-input placeholder='请输入申请人' v-model='queryParam.applicantName'></a-input>
            </a-form-item>
          </a-col>
          <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
           <a-col :md='6' :sm='24'>
               <a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
               <a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
           </a-col>
        </span>
        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class='table-operator'>
      <a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table
        ref='table'
        size='middle'
        bordered
        rowKey='id'
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
        :loading='loading'
        @change='handleTableChange'>

        <span slot='action' slot-scope='text, record'>
          <a v-if="record.status=='0'" @click='postSubmit(record.id,"审核通过","/his/administrative/approval/auditSuc")'>审核通过</a>
          <a-divider type='vertical' v-if="record.status=='0'"/>
          <a v-if="record.status=='0'" @click='postSubmit(record.id,"审核不通过","/his/administrative/approval/auditFail")'>审核不通过</a>
          <a-divider type='vertical' v-if="record.status=='0'" />
          <a-dropdown v-if="record.status=='0'">
            <a class='ant-dropdown-link'>更多 <a-icon type='down' /></a>
                <a-menu slot='overlay'>
                      <a-menu-item>
                        <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
                          <a>删除</a>
                        </a-popconfirm>
                      </a-menu-item>
                </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <HHisApproval-modal ref='modalForm' @ok='modalFormOk'></HHisApproval-modal>
  </a-card>
</template>
<script>
import '@assets/less/TableExpand.less'
import HHisApprovalModal from './modules/HHisApprovalModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { putAction, getAction, postAction } from '@api/manage'
import { frozenBatch } from '@api/api'

export default {
  name: 'h_his_activityList',
  mixins: [JeecgListMixin],
  components: {
    HHisApprovalModal
  },
  data() {
    return {
      description: '行政审批管理管理页面',
      labelCol: { style: { width: '80px' } },
      // 表头
      columns: [
        {
          title: '申请人',
          align: 'center',
          dataIndex: 'applicantName'
        },
        {
          title: '申请人部们',
          align: 'center',
          dataIndex: 'applicantDepart'
        },
        {
          title: '申请事项',
          align: 'center',
          dataIndex: 'content'
        },
        {
          title: '审核状态',
          align: 'center',
          dataIndex: 'status_dictText'
        },
        {
          title: '审核人名称',
          align: 'center',
          dataIndex: 'auditName'
        },
        {
          title: '审核时间',
          align: 'center',
          dataIndex: 'auditTime'
        },
        {
          title: '审核备注',
          align: 'center',
          dataIndex: 'remark'
        },
        {
          title: '创建时间 ',
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/his/administrative/approval/list',
        delete: '/his/administrative/approval'
      }
    }
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {

  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>